package com.winhxd.b2c.customer.util;

import com.winhxd.b2c.common.domain.message.condition.MiniTemplateData;
import org.apache.http.message.BasicNameValuePair;

import java.util.ArrayList;
import java.util.List;

public class TemplateData {

    private List<MiniTemplateData> data = new ArrayList<>();

    public static TemplateData New() {
        return new TemplateData();
    }

    public List<MiniTemplateData> getData() {
        return this.data;
    }

    public TemplateData add(String key, String value) {
        this.data.add(new MiniTemplateData(key,value));
        return this;
    }

    public TemplateData addFlag(Boolean flag, String key, String value) {
        if (flag){
            this.data.add(new MiniTemplateData(key,value));
        }
        return this;
    }

}
